<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="p_product" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="gotoPage(''+vueparams+'')" type='primary' size="mini">生成盘存报告</el-button>
      <el-button @click="gotoPage('/psi/supplychainmana/InventoryDet?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 产品列表 </span>
      </div>
      <el-table :data="p_product">
        <el-table-column label="#" align="center" type='index'>
        </el-table-column>
        <el-table-column label="产品条形码" prop="product_barcode">
        </el-table-column>
        <el-table-column label="产品名称" prop="note_id">
          <template slot-scope="scope">
            <el-link @click="popReportDetailsSupply('&CMIDnote_id='+scope.row.note_id+'')" type='primary'>{{scope.row.product_name}}</el-link>
          </template>
        </el-table-column>
        <el-table-column label="产品厂家" prop="client_name">
        </el-table-column>
        <el-table-column label="规格型号" prop="model_norm">
        </el-table-column>
        <el-table-column label="储存位置" prop="name">
        </el-table-column>
        <el-table-column label="价格" prop="product_price">
        </el-table-column>
        <el-table-column label="结余数" prop="product_num">
        </el-table-column>
        <el-table-column label="盘存数" prop="take_num">
        </el-table-column>
        <el-table-column label="损益数" prop="pln">
        </el-table-column>
        <el-table-column label="盘存时间" prop="implement_end_date">
          <template slot-scope="scope">
            {{getDateTimeString(scope.row,'implement_end_date')}}
          </template>
        </el-table-column>
        <el-table-column label="库管员处理时间" prop="take_diff_date">
          <template slot-scope="scope">
            {{getDateTimeString(scope.row,'take_diff_date')}}
          </template>
        </el-table-column>
        <el-table-column label="组长审批时间" prop="take_process_date">
          <template slot-scope="scope">
            {{getDateTimeString(scope.row,'take_process_date')}}
          </template>
        </el-table-column>
        <el-table-column label="会计处理时间" prop="take_accoun_date">
          <template slot-scope="scope">
            {{getDateTimeString(scope.row,'take_accoun_date')}}
          </template>
        </el-table-column>
        <el-table-column label="经理确认时间" prop="take_confin_date">
          <template slot-scope="scope">
            {{getDateTimeString(scope.row,'take_confin_date')}}
          </template>
        </el-table-column>
        <el-table-column label="库存状态" prop="take_state">
          <template slot-scope="scope">
            {{getValueName("正常=0,差异=1",scope.row.take_state)}}
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total>0" :total="total" :limit.sync="pageSize" @pagination="getPage" />
    </el-form>
    <el-dialog :visible.sync="ReportDetailsSupplyVisible" append-to-body>
      <ReportDetailsSupply v-if="ReportDetailsSupplyVisible" ref="ReportDetailsSupply" :popparams="popparams"> </ReportDetailsSupply>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import ReportDetailsSupply from "@/views/psi/supplychainmana/ReportDetailsSupply";
  export default {
    name: 'inventoryStatementSupply',
    components: {
      ReportDetailsSupply,
    },
    props: ['popparams'],
    data() {
      return {
        ReportDetailsSupplyVisible: false,
        ReportDetailsSupplyValue: null,
        ReportDetailsSupplyDesc: null,
        vueparams: this.getVUEParams(""),
        p_product: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/inventoryStatementSupply?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      popReportDetailsSupply(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.ReportDetailsSupplyVisible = !this.ReportDetailsSupplyVisible;
      },
    },
  }
</script>
